
class PROTOSER():
    
    E_FSMRX_WSYNC1   = 0
    E_FSMRX_WSYNC2   = 1
    E_FSMRX_WSYNC3   = 2
    E_FSMRX_HEADER   = 3
    E_FSMRX_BODY     = 4
    E_FSMRX_FOOTER   = 5
    E_FSMRX_COMPLETE = 6
    E_FSMRX_BADCRC   = 7
    

    HPOS_SYNC1       = 0
    HPOS_SYNC2       = 1
    HPOS_SYNC3       = 2
    HPOS_CODE        = 3
    HPOS_LENMSB      = 4
    HPOS_LENLSB      = 5
    BPOS_DATA_START  = 6
    
    HLENGTH          = 6
    BLENGTH_MAX      = 247
    FLENGTH          = 2
    FRAME_LENGTH     = (HLENGTH+BLENGTH_MAX+FLENGTH)
    
    HVAL_SYNC1       = '<'
    HVAL_SYNC2       = '$'
    HVAL_SYNC3       = '>'
    
    HVAL_CODE00      = 0x00
    HVAL_CODE01      = 0x01
    HVAL_CODE02      = 0x02
    HVAL_CODE03      = 0x03
    HVAL_CODE04      = 0x04

if __name__ == "__main__":
    print "header",PROTOSER.HLENGTH
    print "body(max)",PROTOSER.BLENGTH_MAX
    print "footer",PROTOSER.FLENGTH
    print "total",PROTOSER.FRAME_LENGTH